Set goahead `Requestchoice "Change costs""This script will set up all your phone costs.*nIf it fails to work, refer to the docs under troubleshooting*nAs this is the first time you ran this, you must set it up, or Miami Control will fail to work.*nUK (i.e. BT) defaults will be set up. If they are correct, just cancel each requester*nuntil it asks you if your settings are correct.""Change|Stop!"`
Setenv peakrate 3.95
Setenv eveningrate 1.5
Setenv weekendrate 1
setenv mincharge 5
Set peakstart 08
Set peakend 18
Else
set peakstart `Echo $peakratetimes first=0 len=2`
set peakend `Echo $peakratetimes len=2`
Set goahead `Requestchoice "Change costs""This script will set up all your phone costs.*nIf it fails to work, refer to the docs under troubleshooting*n*nYour current settings are:*n*nPeak Rate = $peakrate*nEvening Rate = $eveningrate*nWeekend Rate = $weekendrate*nMinimum charge = $mincharge*nPeak rate starts at $peakstart:00*nPeak rate ends at $peakend:00.*n""Change|Stop!"`
Endif
If $goahead EQ 1
setenv peakrate `Requeststring "Phone Costs""Please enter how much your*npeak rate calls cost per minute in Pence*nCurrently $peakrate." reqpos centre`
setenv eveningrate `Requeststring "Phone Costs""Please enter how much your*n evening rate calls cost per minute in Pence*nCurrently $eveningrate." reqpos centre`
setenv weekendrate `Requeststring "Phone Costs""Please enter how much your*n weekend rate calls cost per minute in Pence*nCurrently $weekendrate." reqpos centre`
setenv mincharge `Requeststring "Phone Costs""Please enter your providers minimum charge*nCurrently $mincharge." reqpos centre`
set peakstart `RequestString "Peak Rate Time""Please enter the hour peak rate starts.*ne.g. for UK users, enter *"08*"*n*nCurrently $peakstart*n*nNote: You MUST enter 2 figures here, as in the example!" reqpos centre`
set peakend `RequestString "Peak Rate Time""Please enter the hour peak rate ends.*ne.g. for UK users, enter *"18*"*n*nCurrently $peakend*n*nNote: You MUST enter 2 figures here, as in the example!" reqpos centre`
Set save `Requestchoice "Save?""Your setting are now:*n*nPeak Rate = $peakrate*nEvening Rate = $eveningrate*nWeekend Rate = $weekendrate*nMinimum charge = $mincharge*nPeak rate starts at $peakstart:00*nPeak rate ends at $peakend:00.*n*nAre these correct?""Yes - Save|No - Discard"`
If $save EQ 1
Copy Env:peakrate Envarc:
Copy Env:eveningrate Envarc:
Copy Env:weekendrate Envarc:
Copy Env:mincharge Envarc:
Echo $peakstart >Env:peakratetimes NOLINE
Echo $peakend >>Env:peakratetimes
Copy Env:peakratetimes Envarc:
Requestchoice "Done""Your settings have been updated""Good" >NIL:
Else
Copy Envarc:peakrate Env:
Copy Envarc:eveningrate Env:
Copy Envarc:weekendrate Env:
copy Envarc:mincharge Env:
Requestchoice "Finished""Settings restored to old values""Good" >NIL: